package com.hnx.admin.aurora.system.domain.convert.dept;

import com.hnx.admin.aurora.system.domain.dto.dept.entity.DeptDTO;
import com.hnx.admin.aurora.web.json.TreeNodeVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.ReportingPolicy;

import java.util.List;
@Mapper(componentModel = "spring",unmappedSourcePolicy = ReportingPolicy.IGNORE)
public interface DeptConvert {
    @Mappings({
            @Mapping(target = "id",source = "deptId"),
            @Mapping(target = "label",source = "deptName"),
            @Mapping(target = "parentId",source = "parentId"),
            @Mapping(target = "orderNum",source = "orderNum")
    })
    TreeNodeVO toTree(DeptDTO deptDTO);
    List<TreeNodeVO> toTreeList(List<DeptDTO> list);
}
